﻿using AutoMapper;
using System.ComponentModel;

namespace ViewModel.AccountModel
{
    public class Account : AccountBase
    {
        [DisplayName("编号")]
        public int Id { get; set; }
        [DisplayName("账户名称")]
        public string AccountName { get; set; }
        [DisplayName("昵称")]
        public string NickName { get; set; }
        [DisplayName("真实姓名")]
        public string RealName { get; set; }
    }


    public class AccountProfile : Profile
    {
        public AccountProfile()
        {
            CreateMap<Account, Domain.Models.Account>()
                .ForMember(des => des.UserName, source => source.MapFrom(x => x.AccountName))
                .ForMember(des => des.Name, source => source.MapFrom(x => x.RealName))
                .ReverseMap();
        }
    }
}
